import { createBrowserRouter } from "react-router-dom";
import Mylayout from "../views/Mylayout/Mylayout";
import Home from "../views/Home/Home";
import Fang from "../views/Fang/Fang";


export const Myrouter = [
    {
        key:'/',
        label:"二级菜单",
        children:[
            {
                key:"/home",
                path:"/home",
                label:"首页",
                element:<Home></Home>,
            },
            {
                key:"/fang",
                path:"/fang",
                label:"防抖",
                element:<Fang></Fang>,
            },
        ]
    }
]


const routers = [
  {
    path: "/",
    element: <Mylayout></Mylayout>,
    children:Myrouter
  },
];

export const router = createBrowserRouter(routers);

export default router;
